<!DOCTYPE html>
<html>
<head>
<title>execCommand("insertImage") src attribute</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
function insertImageTest(value, innerHTML) {
    test(function() {
        var element = document.createElement("div");
        element.contentEditable = true;
        document.body.appendChild(element);
        element.focus();
        document.execCommand("insertImage", false, value);
        assert_equals(element.innerHTML, innerHTML);
        document.body.removeChild(element);
    }, 'document.execCommand("insertImage", false, ' + value + ')');
}
insertImageTest(undefined, "<img>");
insertImageTest(null, '<img src="null">');
insertImageTest("", "<img>");
insertImageTest(" ", '<img src=" ">');
insertImageTest("image", '<img src="image">');
</script>
</body>
</html>
